package com.sikaryofficial.workbench.domain.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 价格区间对象 price_tier_t
 *
 * @author wuweihong
 * @date 2024-09-23
 */
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ToString
@TableName("price_tier_t")
public class PriceTier implements Serializable {
    private static final long serialVersionUID = 1L;

    public PriceTier(Integer minQuantity, Integer maxQuantity, BigDecimal unitPrice) {
        this.minQuantity = minQuantity;
        this.maxQuantity = maxQuantity;
        this.unitPrice = unitPrice;
    }

    /**
     * 价格区间ID
     */
    @TableId(type = IdType.ASSIGN_ID, value = "price_tier_id")
    private Long priceTierId;
    /**
     * 商品ID
     */
    private Long goodsId;
    /**
     * 最小数量
     */
    private Integer minQuantity;
    /**
     * 最大数量
     */
    private Integer maxQuantity;
    /**
     * 单价
     */
    private BigDecimal unitPrice;
    /**
     * 币种
     */
    private String currency;
    /**
     * 租户号
     */
    private Integer tenantId;
    /**
     * 乐观锁
     */
    private Integer revision;
    /**
     * 创建人
     */
    @TableField(fill = FieldFill.INSERT)
    private Long createdBy;
    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private Date createdTime;
    /**
     * 更新人
     */
    @TableField(fill = FieldFill.UPDATE)
    private Long updatedBy;
    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.UPDATE)
    private Date updatedTime;
    /**
     * 删除版本：默认为0；删除则赋值当前记录主键ID
     */
    private Long deletedVersion;
}
